package com.bedrock.project.inside.service.impl;

import java.util.List;
import com.bedrock.common.utils.DateUtils;
import com.bedrock.project.inside.service.IWorkHourTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bedrock.project.inside.mapper.WorkHourTypeMapper;
import com.bedrock.project.inside.entity.WorkHourType;

/**
 * 工时分类Service业务层处理
 * 
 * @author bedrock
 * @date 2020-04-22
 */
@Service
public class WorkHourTypeServiceImpl implements IWorkHourTypeService
{
    @Autowired
    private WorkHourTypeMapper workHourTypeMapper;

    /**
     * 查询工时分类
     * 
     * @param workHourTypeId 工时分类ID
     * @return 工时分类
     */
    @Override
    public WorkHourType selectWorkHourTypeById(Long workHourTypeId)
    {
        return workHourTypeMapper.selectWorkHourTypeById(workHourTypeId);
    }

    /**
     * 查询工时分类列表
     * 
     * @param workHourType 工时分类
     * @return 工时分类
     */
    @Override
    public List<WorkHourType> selectWorkHourTypeList(WorkHourType workHourType)
    {
        return workHourTypeMapper.selectWorkHourTypeList(workHourType);
    }

    /**
     * 新增工时分类
     * 
     * @param workHourType 工时分类
     * @return 结果
     */
    @Override
    public int insertWorkHourType(WorkHourType workHourType)
    {
        workHourType.setCreateTime(DateUtils.getNowDate());
        return workHourTypeMapper.insertWorkHourType(workHourType);
    }

    /**
     * 修改工时分类
     * 
     * @param workHourType 工时分类
     * @return 结果
     */
    @Override
    public int updateWorkHourType(WorkHourType workHourType)
    {
        workHourType.setUpdateTime(DateUtils.getNowDate());
        return workHourTypeMapper.updateWorkHourType(workHourType);
    }

    /**
     * 批量删除工时分类
     * 
     * @param workHourTypeIds 需要删除的工时分类ID
     * @return 结果
     */
    @Override
    public int deleteWorkHourTypeByIds(Long[] workHourTypeIds)
    {
        return workHourTypeMapper.deleteWorkHourTypeByIds(workHourTypeIds);
    }

    /**
     * 删除工时分类信息
     * 
     * @param workHourTypeId 工时分类ID
     * @return 结果
     */
    @Override
    public int deleteWorkHourTypeById(Long workHourTypeId)
    {
        return workHourTypeMapper.deleteWorkHourTypeById(workHourTypeId);
    }
}
